<?php
/**
 * wondershare 配置文件
 * ============================================================================
 * 版权所有 (C) 2011 万兴软件，并保留所有权利。
 * 网站地址: http://www.wondershare.net
 * ----------------------------------------------------------------------------
 * $Author: yuanta@wondershare.net $
 * $Date:2011-05-07 15:57:17 $
 * $Id: config.php 2011-05-07 15:57:17 $
*/
session_start();
if (!defined('IN_WONDERSHARE'))
{
	die('Hacking attempt');
}
if (__FILE__ == '')
{
	die('Fatal error code: 0');
}

if(!$_SESSION['AName'])
{
	session_start();
}
/* 取得当前wondershare所在的根目录 */
define('ROOT_PATH', str_replace('includes/init.php', '', str_replace('\\', '/', __FILE__)));

include_once(ROOT_PATH . './inc/config.inc.php');
include_once('../conf/conf.php');

if (defined('DEBUG_MODE') == false)
{
    define('DEBUG_MODE', 0);
}

if (PHP_VERSION >= '5.1' && !empty($timezone))
{
    date_default_timezone_set($timezone);
}
//
include_once(ROOT_PATH . 'includes/cls_ecshop.php');
include_once(ROOT_PATH . 'includes/lib_time.php');
include_once(ROOT_PATH . 'includes/lib_common.php');
include_once(ROOT_PATH . 'includes/lib_main.php');

include_once(ROOT_PATH . 'includes/task_common.php');

/* 对用户传入的变量进行转义操作。*/
if (!get_magic_quotes_gpc())
{
    if (!empty($_GET))
    {
        $_GET  = addslashes_deep($_GET);
    }
    if (!empty($_POST))
    {
        $_POST = addslashes_deep($_POST);
    }

    $_COOKIE   = addslashes_deep($_COOKIE);
    $_REQUEST  = addslashes_deep($_REQUEST);
}

/* 初始化数据库类 */
require(ROOT_PATH . 'includes/cls_mysql.php');
$db_new = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
$GLOBALS['db']=$db_new;

/**
 * 系统初始
 */
require('../plug/smarty/template.php');//smarty
$GLOBALS['smarty']= new tempsmarty();

?>